package me.jessyan.mvparms.demo.mvp.contract;

import android.app.Activity;

import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IPresenter;
import com.jess.arms.mvp.IView;

import io.reactivex.Observable;
import me.jessyan.mvparms.demo.data.entity.MessageInfoEntity;
import me.jessyan.mvparms.demo.data.entity.TopResponse;
import me.jessyan.mvparms.demo.data.entity.UploadImgEntity;
import okhttp3.MultipartBody;

/**
 * @Author: 海洋
 * @Date: 2018/8/22
 * @Desc:
 */
public interface RichEditorContract {
    interface View extends IView {
        Activity getActivity();

        void startInsertImageUrl(String imageUrl);

        void startInsertHtml(String htmlStr);
    }

    //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,如是否使用缓存
    interface Model extends IModel {
        Observable<TopResponse<UploadImgEntity>> uploadImage(MultipartBody.Part imgs);

        Observable<TopResponse<MessageInfoEntity>> getMessageInfoById(String id);

        Observable<TopResponse<Object>> addMessage(String title, String content);

        Observable<TopResponse<Object>> editMessage(String id, String title, String content);
    }

    interface Presenter extends IPresenter {
        void uploadImage(MultipartBody.Part imgs);

        void getMessageInfoById(String id);

        void addMessage(String title, String content);

        void editMessage(String id, String title, String content);
    }
}
